package com.flower.auth.common.enums;

import lombok.Getter;

/**
 * @author lavender
 * 删除状态枚举
 * @version 1.0
 * @date 2024-07-03 12:01
 */
@Getter
public enum IsDeletedFlagEnum {

    DELETE(1, "已删除"),
    UN_DELETED(0, "未删除");

    private Integer code;
    private String message;

    IsDeletedFlagEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public static IsDeletedFlagEnum getByCode(Integer code) {
        for (IsDeletedFlagEnum resultCodeEnum : IsDeletedFlagEnum.values()) {
            if (resultCodeEnum.getCode().equals(code)) {
                return resultCodeEnum;
            }
        }
        return null;
    }
}
